package com.hankol.newretail.adapter

import android.widget.ImageView
import android.widget.LinearLayout
import com.baselibrary.extension.checkValue
import com.baselibrary.utils.GlideUtils
import com.baselibrary.utils.ScreenUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.hankol.newretail.R
import com.hankol.newretail.bean.JinGIcon
import com.hankol.newretail.bean.MenuBean

/* */
class MallMenuChildAdapter : BaseQuickAdapter<JinGIcon, BaseViewHolder>(R.layout.item_mall_menu) {

    override fun convert(helper: BaseViewHolder, item: JinGIcon) {
        GlideUtils.loadImg_101(mContext, item.iconUrl.checkValue(), helper.getView<ImageView>(R.id.img_cover))
        helper.setText(R.id.tv_name, item.name.checkValue())
        val llRoot = helper.getView<LinearLayout>(R.id.ll_root)
        val lp = llRoot.layoutParams
        lp.width = ScreenUtils.getScreenWidth().div(5)
        llRoot.layoutParams = lp
    }
}